<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="../../base.jsp"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<sys:genericTag4o id="templateTable" methodName="getTemplateTable" className="com.tmpt.controller.taglib.TemplateTag">
	<sys:columnTag columnName="keyRandom" columnValue="${paramValues._keyRandom[0]}"/>
</sys:genericTag4o>
<html>
<head>
<title>My first chart using FusionCharts Suite XT</title>
<script type="text/javascript" src="${path}/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="../../../js/fusioncharts-suite-xt/js/fusioncharts.js"></script>
<script type="text/javascript" src="../../../js/fusioncharts-suite-xt/js/themes/fusioncharts.theme.fint.js"></script>

<script type="text/javascript" src="../../../js/fusioncharts-suite-xt/js/fusioncharts.charts.js"></script>
<script type="text/javascript" src="../../../js/fusioncharts-suite-xt/js/fusioncharts.gantt.js"></script>
<script type="text/javascript" src="../../../js/fusioncharts-suite-xt/js/fusioncharts.maps.js"></script>
<script type="text/javascript" src="../../../js/fusioncharts-suite-xt/js/fusioncharts.powercharts.js"></script>
<script type="text/javascript" src="../../../js/fusioncharts-suite-xt/js/fusioncharts.ssgrid.js"></script>
<script type="text/javascript" src="../../../js/fusioncharts-suite-xt/js/fusioncharts.treemap.js"></script>
<script type="text/javascript" src="../../../js/fusioncharts-suite-xt/js/fusioncharts.widgets.js"></script>
<script type="text/javascript" src="../../../js/fusioncharts-suite-xt/js/fusioncharts.zoomscatter.js"></script>

<script type="text/javascript">
var chartWidth = '${templateTable.chartWidth}';
var chartHeight = '${templateTable.chartHeight}';
if(chartWidth=='0'){
	chartWidth =500;
}
if(chartHeight=='0'){
	chartHeight =350;
}

var _chartType = '${paramValues._chartType[0]}';
if(_chartType == ''){
	_chartType = 'spline';
}

var _chartColumn = '${paramValues._chartColumn[0]}';
if(_chartColumn == ''){
	alert('_chartColumn不能为空');
}


$(function(){
	$.ajax({
		type:"POST",
		url:'${path}/admin123/template/charts/chartAjax_chartSingleJson.action?_keyRandom=${paramValues._keyRandom[0]}',
		dataType:"json",
		data:{'chartColumn':_chartColumn},
		success:function(msg){
			var fusioncharts = new FusionCharts({
        		"type": _chartType,//line,column2d,column3d,"spline"
			    renderAt: 'chart-container',
                width: '100%',
                height: '100%',
			    dataFormat: 'json',
			    dataSource: msg
			}
			);
    		fusioncharts.render();
		},
		error:function(er){
	         window.parent.error(er);
		}
	});
})


/*
  FusionCharts.ready(function(){
    var revenueChart = new FusionCharts({
        "type": "column3d",
        "renderAt": "chartContainer",
        "width": "500",
        "height": "300",
        "dataFormat": "json",
        "dataSource":  {
          "chart": {
            "caption": "Monthly revenue for last year",
            "subCaption": "Harry's SuperMart",
            "xAxisName": "Month",
            "yAxisName": "Revenues (In USD)",
            "theme": "fint"
         },
         "data": [
            {
               "label": "Jan",
               "value": "420000"
            },
            {
               "label": "Feb",
               "value": "810000"
            },
            {
               "label": "Mar",
               "value": "720000"
            },
            {
               "label": "Apr",
               "value": "550000"
            },
            {
               "label": "May",
               "value": "910000"
            },
            {
               "label": "Jun",
               "value": "510000"
            },
            {
               "label": "Jul",
               "value": "680000"
            },
            {
               "label": "Aug",
               "value": "620000"
            },
            {
               "label": "Sep",
               "value": "610000"
            },
            {
               "label": "Oct",
               "value": "490000"
            },
            {
               "label": "Nov",
               "value": "900000"
            },
            {
               "label": "Dec",
               "value": "730000"
            }
          ]
      }

  });
revenueChart.render();
})
*/
</script>
</head>
<body>
  <div id="chart-container">FusionCharts XT will load here!</div>
</body>
</html>  

